//
/***********************************************************
             File name:      main.c
             Author:         Bitat (陆叁柒)
             Email :         Bitat@qq.com
             Gitee :         https://gitee.com/bitat
             CSDN  :         https://blog.csdn.net/bitat 
             History:        2023/4/2
************************************************************/  
    

#include <stdio.h>
#include <math.h>

int main(void)
{
    int i = 0;    
    for(i = 10000; i < 99999; i++)      //10000-99999之间循环          
    {  
        int j = 0;  
        int sum = 0;  
        for(j = 1; j <5; j++)   
        {
            int n = (int)pow(10, j);    //10的次方 10 100 1000 10000 
            sum += (i%n) * (i/n);       //求最后一位和前面数字的乘积，循环五次
        }
        if(sum == i)                    //判断是否相等
        {
            printf("%d ",i);
        }
    }
    printf("\n");
    return 0;
}

//eg: 12345
//    1234*5 = (12345/10)*(12345%10)
//    123*45 = (12345/100)*(12345%100)
//    12*345 = (12345/1000)*(12345%1000)
//    1*2345 = (12345/10000)*(12345%10000)
// 注：10的次方用pow来计算
